//Direct3D Framework Header File
//Declares the Framework for DirectX
//Jeffrey Denton	January 11, 2011
#pragma once
#include "Globals.h"

//Subclasses
#include "Laser.h"
#include "Graphics3D.h"
#include "Graphics2D.h"
#include "Camera.hpp"
#include "Light.hpp"

//Convenient Renames
#define DXTEXTURE LPDIRECT3DTEXTURE9
#define ID3DDEVICE IDirect3DDevice9

class GraphicsHandler
{
protected:

	Camera					GameCamera;
	Light					WorldLight;
	Graphics3D				m3DEngine;	//For 3D
	Graphics2D				m2DEngine;	//For 2D	

	IDirect3DDevice9*		mD3DDevice;
	D3DPRESENT_PARAMETERS	D3D_PP;		//Presentation Parameters


public:

	//=====CONSTRUCTORS
	GraphicsHandler();										//Default Constructor
	//=====INITIALIZE
	bool Initialize(HWND, HINSTANCE, bool);					//Initialize DirectX
	bool InitDevice(HWND,bool);
	//=====UPDATE
	void Update(DrawList& drawlist);						//Update DirectX
	void CheckDevice();										//Check if window is being accessed
	//=====RENDER
	bool Draw(DrawList&, SpriteList&, int CurrentState);	//Draw Objects to the Screen
	//=====ACCESSORS
	inline static GraphicsHandler* Into()      
	{static GraphicsHandler engine;return &engine;}
	DXTEXTURE GetTexture(int ID);
	//=====SHUTDOWN
	bool Shutdown();										//Release DirectX Objects
	
};

